<template>
  <div>
    <TypeNav />
    <!--列表-->
    <ListContainer />
    <!--今日推荐-->
    <TodayRecommend />
    <!-- 商品排行 -->
    <Rank />
    <!-- 猜你喜欢 -->
    <Like />
    <!--楼层-->
    <Floor v-for="floor in floors" :key="floor.id" :floor="floor" />
    <!--商标-->
    <Brand />
  </div>
</template>

<script>
import TypeNav from "../../components/TypeNav";
import Brand from "./Brand/Brand.vue";
import Floor from "./Floor/Floor.vue";
import Like from "./Like/Like.vue";
import ListContainer from "./ListContainer/ListContainer.vue";
import Rank from "./Rank/Rank.vue";
import TodayRecommend from "./TodayRecommend/TodayRecommend.vue";

import { reqGetFloors } from "../../api/home";

export default {
  name: "Home",
  components: {
    TypeNav,
    Brand,
    Floor,
    Like,
    ListContainer,
    Rank,
    TodayRecommend,
  },
  data() {
    return {
      floors: [],
    };
  },
  mounted() {
    reqGetFloors()
      .then((response) => {
        this.floors = response;
      })
      .catch((e) => {
        console.log(e);
      });
  },
};
</script>

<style scoped lang="less">
</style>